//
// Created by eddy on 24-3-19.
#include "iostream"

class Animal {
public:
    int age;

    Animal() : age() {
        std::cout << "Animal构造函数" << std::endl;
    }

    ~Animal() {
        std::cout << "Animal析构函数" << std::endl;
    }
};

class Dog : public Animal /* , protected A,private B ... 可以继承多个类 */ {
public:
    int legNum;

    Dog() : legNum(4) {
        std::cout << "Dog构造函数" << std::endl;
    }

    ~Dog() {
        std::cout << "Dog析构函数" << std::endl;
    }
};

int main() {

    Dog dog1;
    std::cout << dog1.age << std::endl;
    return 0;
}